<%@ taglib prefix="sd" uri="/struts-dojo-tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<sd:head/>
<div id="dialog-add" title="添加商品" style="background:white">
	<div id="dialog-popup">
		<div class="sect">
			<s:action name="listCity" namespace="/" id="listCity"/>
			<s:action name="listCategory" namespace="/" id="listCategory"/>
			<s:action name="listMerchant" namespace="/" id="listMerchant"/>

			<s:form method="post" id="add-form" action="addItem" namespace="/admin" theme="simple"
					enctype="multipart/form-data">
				<div class="field">
					<label for="txt_name">商品名称</label>
					<s:textfield size="30" name="item.name" cssClass="f-input" id="txt_name"/>
					<s:fielderror cssClass="field-error">
						<s:param>item.name</s:param>
					</s:fielderror>
				</div>
				<div class="field">
					<label>城市及分类</label>
					<label>
						<select class="tf-input" style="height:25px;" name="cityName">
							<s:iterator id="city" value="#listCity.cities">
								<option><s:property value="#city.chnName"/></option>
							</s:iterator>
						</select>
					</label>
					<label>
						<select class="tf-input" style="height:25px;" name="categoryName">
							<s:iterator id="category" value="#listCategory.categories">
								<option><s:property value="#category.name"/></option>
							</s:iterator>
						</select>
					</label>
				</div>
				<div class="field">
					<label for="txt_title">团购标题</label>

					<div style="float: left;">
						<s:textarea id="txt_title" cssClass="f-textarea"
									name="item.title" rows="3" cols="45"/>
					</div>
				</div>
				<div class="field">
					<label for="txt_feature">团购标题</label>
					<s:textfield id="txt_feature" name="item.feature" cssClass="f-input"
								 cssStyle="height:20px"/>
				</div>

				<div class="field">
					<label for="txt_marketPrice">市场价</label>
					<s:textfield size="10" name="item.marketPrice" cssClass="tf-input"
								 cssStyle="height:20px"
								 id="txt_marketPrice"/>
					<label for="txt_groupPrice">团购价</label>
					<s:textfield size="10" name="item.groupPrice" cssClass="tf-input"
								 cssStyle="height:20px"
								 id="txt_groupPrice"/>
				</div>
				<div class="field">
					<label for="txt_minCount">最低数量</label>
					<s:textfield size="10" name="item.minCount" cssClass="tf-input"
								 cssStyle="height:20px"
								 id="txt_minCount"/>
					<label for="txt_maxCount">最高数量</label>
					<s:textfield size="10" name="item.maxCount" cssClass="tf-input"
								 cssStyle="height:20px"
								 id="txt_maxCount"/>
				</div>
				<div class="field">
					<label>开始日期</label>
					<sd:datetimepicker name="item.beginTime" value="today"
									   cssStyle="width:120px;height:20px;"
									   displayFormat="yyyy年MM月dd日" weekStartsOn="2"/>
				</div>
				<div class="field">
					<label>结束日期</label>
					<sd:datetimepicker name="item.endTime" value="today" displayFormat="yyyy年MM月dd日"
									   cssStyle="width:120px;height:20px;" weekStartsOn="2"/>
					<span class="hint">团购开始于开始日期00:00:00，结束于结束日期00:00:00</span>
				</div>


				<div class="field">
					<label for="txt_description">商品简介</label>

					<div style="float: left;">
						<s:textarea id="txt_description" cssClass="f-textarea"
									name="item.description" rows="5" cols="45"/>
					</div>
				</div>
				<div class="field">
					<label>商户</label>
					<label>
						<select class="tf-input" style="height:25px;" name="merchantName">
							<s:iterator id="merchant" value="#listMerchant.merchants">
								<option><s:property value="#merchant.name"/></option>
							</s:iterator>
						</select>
					</label>
				</div>

				<div class="field">
					<label>商品图片1</label>
					<s:file name="upload" cssClass="f-input"/>
				</div>
				<div class="field">
					<label>商品图片2</label>
					<s:file name="upload" cssClass="f-input"/>
				</div>
				<div class="field">
					<label>商品图片3</label>
					<s:file name="upload" cssClass="f-input"/>
				</div>

				<s:submit name="commit" id="submit" cssClass="formsubmit"/>

			</s:form>
		</div>
	</div>
</div>